<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: DS3231 Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classfabgl_1_1_d_s3231.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfabgl_1_1_d_s3231-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">DS3231 Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> Real Time Clock driver.  
 <a href="classfabgl_1_1_d_s3231.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_d_s3231_8h_source.html">DS3231.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4a47f12debf6d5d7273c3e5fb360417a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">available</a> ()</td></tr>
<tr class="memdesc:a4a47f12debf6d5d7273c3e5fb360417a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if <a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> is reachable.  <a href="classfabgl_1_1_d_s3231_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">More...</a><br /></td></tr>
<tr class="separator:a4a47f12debf6d5d7273c3e5fb360417a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd45c96e11bf7479f3a75d4cd4975878"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_acd45c96e11bf7479f3a75d4cd4975878.html#acd45c96e11bf7479f3a75d4cd4975878">begin</a> (<a class="el" href="classfabgl_1_1_i2_c.html">I2C</a> *i2c)</td></tr>
<tr class="memdesc:acd45c96e11bf7479f3a75d4cd4975878"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes <a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> driver.  <a href="classfabgl_1_1_d_s3231_acd45c96e11bf7479f3a75d4cd4975878.html#acd45c96e11bf7479f3a75d4cd4975878">More...</a><br /></td></tr>
<tr class="separator:acd45c96e11bf7479f3a75d4cd4975878"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afde0362b6ad07f120d3a03ed191a54cb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_afde0362b6ad07f120d3a03ed191a54cb.html#afde0362b6ad07f120d3a03ed191a54cb">clockEnabled</a> (bool value)</td></tr>
<tr class="memdesc:afde0362b6ad07f120d3a03ed191a54cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables <a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> oscillator.  <a href="classfabgl_1_1_d_s3231_afde0362b6ad07f120d3a03ed191a54cb.html#afde0362b6ad07f120d3a03ed191a54cb">More...</a><br /></td></tr>
<tr class="separator:afde0362b6ad07f120d3a03ed191a54cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6eccbc9a02a68038bebb4c9a610b8f7f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structfabgl_1_1_date_time.html">DateTime</a> const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_a6eccbc9a02a68038bebb4c9a610b8f7f.html#a6eccbc9a02a68038bebb4c9a610b8f7f">datetime</a> ()</td></tr>
<tr class="memdesc:a6eccbc9a02a68038bebb4c9a610b8f7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Queries <a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> for current date and time.  <a href="classfabgl_1_1_d_s3231_a6eccbc9a02a68038bebb4c9a610b8f7f.html#a6eccbc9a02a68038bebb4c9a610b8f7f">More...</a><br /></td></tr>
<tr class="separator:a6eccbc9a02a68038bebb4c9a610b8f7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94e15947dfbd16e4f6ef6f4fe0b7ae49"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_a94e15947dfbd16e4f6ef6f4fe0b7ae49.html#a94e15947dfbd16e4f6ef6f4fe0b7ae49">dateTimeValid</a> ()</td></tr>
<tr class="memdesc:a94e15947dfbd16e4f6ef6f4fe0b7ae49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines the validity of datetime.  <a href="classfabgl_1_1_d_s3231_a94e15947dfbd16e4f6ef6f4fe0b7ae49.html#a94e15947dfbd16e4f6ef6f4fe0b7ae49">More...</a><br /></td></tr>
<tr class="separator:a94e15947dfbd16e4f6ef6f4fe0b7ae49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b855984a50fd66687dd28acb8c8cb9f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_a4b855984a50fd66687dd28acb8c8cb9f.html#a4b855984a50fd66687dd28acb8c8cb9f">setDateTime</a> (<a class="el" href="structfabgl_1_1_date_time.html">DateTime</a> const &amp;value)</td></tr>
<tr class="memdesc:a4b855984a50fd66687dd28acb8c8cb9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets current date and time.  <a href="classfabgl_1_1_d_s3231_a4b855984a50fd66687dd28acb8c8cb9f.html#a4b855984a50fd66687dd28acb8c8cb9f">More...</a><br /></td></tr>
<tr class="separator:a4b855984a50fd66687dd28acb8c8cb9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a014e16702b5d223dd46cda87bfb8318b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfabgl_1_1_d_s3231_a014e16702b5d223dd46cda87bfb8318b.html#a014e16702b5d223dd46cda87bfb8318b">temperature</a> ()</td></tr>
<tr class="memdesc:a014e16702b5d223dd46cda87bfb8318b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Forces <a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> to read current temperature.  <a href="classfabgl_1_1_d_s3231_a014e16702b5d223dd46cda87bfb8318b.html#a014e16702b5d223dd46cda87bfb8318b">More...</a><br /></td></tr>
<tr class="separator:a014e16702b5d223dd46cda87bfb8318b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p ><a class="el" href="classfabgl_1_1_d_s3231.html" title="DS3231 Real Time Clock driver.">DS3231</a> Real Time Clock driver. </p>
<p >Example: </p><pre class="fragment">fabgl::I2C    I2C;
fabgl::DS3231 DS3231;

void setup() {
  I2C.begin(GPIO_NUM_4, GPIO_NUM_15);  // 4 = SDA, 15 = SCL (WARN: disconnect VGA connector!!)
  DS3231.begin(&amp;I2C);

  auto dt = DS3231.datetime();
  Serial.printf("%02d/%02d/%d  %02d:%02d:%02d\n", dt.dayOfMonth, dt.month, dt.year, dt.hours, dt.minutes, dt.seconds);
  Serial.printf("temp = %0.3f C\n", DS3231.temperature());
}
</pre> <dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_s_s_d1306__o_l_e_d_2128x64_2_r_t_clock_2_r_t_clock_8ino-example.html#_a2">SSD1306_OLED/128x64/RTClock/RTClock.ino</a>.</dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_d_s3231_8h_source.html#l00102">102</a> of file <a class="el" href="_d_s3231_8h_source.html">DS3231.h</a>.</p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_d_s3231_8h_source.html">DS3231.h</a></li>
<li><a class="el" href="_d_s3231_8cpp_source.html">DS3231.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>fabgl</b></li><li class="navelem"><a class="el" href="classfabgl_1_1_d_s3231.html">DS3231</a></li>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:05 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
